

package com.hazelcast.internal.services;

import com.hazelcast.cluster.MembershipEvent;
import com.hazelcast.cluster.impl.MemberImpl;

/**
 * Membership event fired when a new member is added
 * to the cluster and/or when a member leaves the cluster.
 *
 * @see MembershipAwareService
 */
public class MembershipServiceEvent extends MembershipEvent {

    public MembershipServiceEvent(MembershipEvent e) {
        super(e.getCluster(), e.getMember(), e.getEventType(), e.getMembers());
    }

    /**
     * Returns the removed or added member.
     *
     * @return member which is removed/added
     */
    @Override
    public MemberImpl getMember() {
        return (MemberImpl) super.getMember();
    }
}
